<?php 
namespace app\index\model;
use think\Model;
use think\Session;
use think\Db;
use think\paginate;
header("Content-type: text/html; charset=utf-8");
class Activityissues_model extends Model
{


	//未解决  按钮
	public function unsolved($params)
	{
		$params['problem_status'] = '6';
		$model = Db::table("problem")->where('problem_id',$params['problem_id'])->setField($params);

		$data['logs_operator'] = session('username');
        $data['logs_operation_behavior'] = '未解决任务';
        $data['logs_operation_time'] =  date('Y-m-d H:i:s',time());
		$arr = Db::table('logs')->insert($data);
        
	}

	//未解决 左侧边栏
    public function menu_unsolved($params)
    {
        $menu_unsolved = Db::query("select * from problem WHERE problem_status = 6 order by problem_id desc");
        return $menu_unsolved;
    }


    //待审核 左侧边栏
    public function menu_pending($params)
    {
        $menu_pending = Db::query("select * from problem WHERE problem_status = 9 order by problem_id desc");
        return $menu_pending;
    }



    //已拒绝 左侧边栏
    public function menu_rejected($params)
    {
        $menu_rejected = Db::query("select * from problem WHERE problem_status = 1 order by problem_id desc");
        return $menu_rejected;
    }


    //任务 左侧边栏
    public function menu_task($params)
    {
        $menu_task = Db::query("select * from problem WHERE problem_type = 0 order by problem_id desc");
        return $menu_task;
    }

    //缺陷 左侧边栏
    public function menu_defect($params)
    {
        $menu_defect = Db::query("select * from problem WHERE problem_type = 1 order by problem_id desc");
        return $menu_defect;
    }


    //需求 左侧边栏
    public function menu_demand($params)
    {
        $menu_demand = Db::query("select * from problem WHERE problem_type = 2 order by problem_id desc");
        return $menu_demand;
    }

    //急  左侧边栏
    public function menu_anxious($params)
    {
        $menu_anxious = Db::query("select * from problem WHERE problem_priority = 0 order by problem_id desc");
        return $menu_anxious;
    }
    //高  左侧边栏
    public function menu_high($params)
    {
        $menu_high = Db::query("select * from problem WHERE problem_priority = 1 order by problem_id desc");
        return $menu_high;
    }
    //中  左侧边栏
    public function menu_in($params)
    {
        $menu_in = Db::query("select * from problem WHERE problem_priority = 2 order by problem_id desc");
        return $menu_in;
    }
    //低  左侧边栏
    public function menu_low($params)
    {
        $menu_low = Db::query("select * from problem WHERE problem_priority = 3 order by problem_id desc");
        return $menu_low;
    }


    //我的待办 左侧边栏
    public function menu_my_agent($params)
    {
        $username = session('username');
        $menu_my_agent = Db::query("select * from problem WHERE problem_dealer = '$username' order by problem_id desc");
        return $menu_my_agent;
    }

    //我的测试 左侧边栏
    public function menu_my_tester($params)
    {
        $username = session('username');
        $menu_my_tester = Db::query("select * from problem WHERE problem_tester = '$username' order by problem_id desc");
        return $menu_my_tester;
    }
}